HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/orbi-individual/node_modules/next/dist/esm/lib/has-necessary-dependencies.js
import { existsSync, promises as fs } from "fs";
import { resolveFrom } from "./resolve-from";
import { dirname, join, relative } from "path";
export async function hasNecessaryDependencies(baseDir, requiredPackages) {
    let resolutions = new Map();
    const missingPackages = [];
    await Promise.all(requiredPackages.map(async (p)=>{
        try {
            const pkgPath = await fs.realpath(resolveFrom(baseDir, `${p.pkg}/package.json`));
            const pkgDir = dirname(pkgPath);
            if (p.exportsRestrict) {
                const fileNameToVerify = relative(p.pkg, p.file);
                if (fileNameToVerify) {
                    const fileToVerify = join(pkgDir, fileNameToVerify);
                    if (existsSync(fileToVerify)) {
                        resolutions.set(p.pkg, fileToVerify);
                    } else {
                        return missingPackages.push(p);
                    }
                } else {
                    resolutions.set(p.pkg, pkgPath);
                }
            } else {
                resolutions.set(p.pkg, resolveFrom(baseDir, p.file));
            }
        } catch (_) {
            return missingPackages.push(p);
        }
    }));
    return {
        resolved: resolutions,
        missing: missingPackages
    };
}

//# sourceMappingURL=has-necessary-dependencies.js.map